<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<img src="img/company-2.png" id="img"/>
		<canvas id="canvas" width="600" height="600">
			
		</canvas>
		<button type="button" onclick="">x重复</button>
	</body>
	<script type="text/javascript">
		var img = document.getElementById("img");
		
		function draw(){
			var canvas = document.getElementById("canvas");
			var context = canvas.getContext("2d");
			context.strokeRect(0,0,300,300);
			context.beginPath();
			context.moveTo(0,0);
			context.lineTo(0,600);
			context.lineWidth = "350";
			var pattern = context.createPattern(img,"repeat");
			context.strokeStyle = pattern;
			context.stroke();
		}
		window.addEventListener("load",draw,true);
	</script>
</html>
